package com.xiaoyu.lanling.view;

import com.xiaoyu.base.app.AppEngine;
import com.xiaoyu.lanling.activity.base.BaseFragment;

public abstract class OnShowFragment extends BaseFragment {

    public void onShow() {
        if (AppEngine.getInstance().hasFinishedInitialJob()) {
            doOnShowAfterAppFinishInit();
        } else {
            AppEngine.getInstance().addFinishInitialJobCallback(this::doOnShowAfterAppFinishInit);
        }
    }

    public void onHide() {
    }

    private void doOnShowAfterAppFinishInit() {
        showStatus("doOnViewCreatedAfterAppFinishInit");
        onShowSafelyAfterAppFinishInit();
    }

    protected void onShowSafelyAfterAppFinishInit() {

    }
}
